.TH "MLDWD" "1" "October 11, 2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
mldwd \- an MLDonkey companion to watch over torrents being seeded.
.SH "SYNOPSIS"
.HP 17
\fBmldwd\fR { torrents | stats | purge }
.SH "DESCRIPTION"
.PP
MLDonkey is a great p2p client, but it has two, ummm, peculiarities that annoy the
hell out of me. First, the upstats counters are reset each time the core stops;
second, there is no mechanism to stop seeding torrents automatically that I know
about. This script addresses these very issues: it keeps the counters safe from
reset and it stops torrents seeding after a certain UL/DL ratio.
.SH "COMMANDS"
.PP
\fBtorrents\fR
.RS 3n
This command first fetches the counters from MLDonkey, then saves them locally, then
compares each torrent's counter to the threshold, then commits the torrents which
have their counters over the threshold.
.PP
The 'commit' term means that the downloaded file or directory is moved out of the place
where MLDonkey has put it. Then MLDonkey should sooner or later move this torrent
to 'old' directory and it will stop this torrent from showing in the upstats, and then
it will be purged (see below).
.PP
Threshold is determined by a special file inside the counter directory or a default
value if the file doesn't exist. So, if you need to override the default maximum UL/DL
ratio, you should create a file named '.max' with a size of ten times the percentage
(this is because the counters are calibrated in tenths of percent). To remove the
threshold completely, make this file zero-sized.
.PP
Normally, this command is run from cron (every ten minutes by default); if you have to
run it manually, doing so as mldonkey user is highly recommended.
.RE
.PP
\fBstats\fR
.RS 3n
This command shows current aggregated counters of all the torrents being watched over.
.RE
.PP
\fBpurge\fR
.RS 3n
This command purges the counters for torrents no longer being seeded. Normally it runs
from cron once an hour to delete the old directories. Again, run it as mldonkey user
to run it manually.
.RE
.SH "BUGS AND LIMITATIONS"
.PP
To be honest, I don't believe someone besides me will actually use this script, so I do not
feel much like polishing it. It kind of works for me, and that's all I want it to do.
.PP
Although MLDonkey is a multi-protocol p2p client, mldwd was designed only with torrents
in mind. The chance it will work with any other protocol is quite tiny. As you may expect
you are encouraged to extend it yourself (wink).
.PP
It was not tested heavily against various esoteric (but possible) situations, so if you
encounter any unexpected behaviour, send the report (or maybe fix it yourself).
.SH "SEE ALSO"
.PP
mlnet (1)
.SH "LICENSE"
.PP
This manual page is public domain.
.SH "AUTHOR"
.PP
stronny@celestia.ru
